$(document).ready(function () {
	ccssbb.onload();
})

var ccssbb = (function () {

	var init = function () {}

	return {
		onload: function () {
			init();
			ccssbb.dateShow('#form_nsywyxqq','#form_nsywyxqz');
			ccssbb.dateShow1('#form_tbrq');
		},
		/*日期显示*/
		/*日期显示*/
        dateShow:function(dom1,dom2){
        	layui.use('laydate', function(){
			  var laydate = layui.laydate;
			  function dateObj(dom1,dom2){//结束时间不小于开始时间
					var startDate = laydate.render({
						elem: dom1,
						done:function(value,date){
							if( value !== '' ){
								endDate.config.min.year = date.year;
								endDate.config.min.month = date.month - 1;
								endDate.config.min.date = date.date;
							}else{
								endDate.config.min.year = '';
								endDate.config.min.month = '';
								endDate.config.min.date = '';
							}
						}
					});
					var endDate  = laydate.render({
						elem: dom2,
						done:function(value,date){
							if( value !== '' ){
								startDate.config.max.year = date.year;
								startDate.config.max.month = date.month - 1;
								startDate.config.max.date = date.date;
							}else{
								startDate.config.max.year = '';
								startDate.config.max.month = '';
								startDate.config.max.date = '';
							}
						}
					});
				}
				dateObj(dom1,dom2);
			})
       },
        //日期显示
        dateShow1:function(dom){
        	 layui.use('laydate', function(){
			  var laydate = layui.laydate;
			  laydate.render({
				    elem: dom,
					theme: 'molv'
			 });
			})
        }
    }
})();